﻿using System;
using System.Collections.Generic;
using System.Text;

namespace twilters
{
    /**
     * Presents one tweetfilter
     */
    public class Filter
    {
        private List<FilterParameter> parameters = new List<FilterParameter>();

        public string Filtername { get; set; }
        public string OwnerUsername { get; set; }

        public int FilterID { get; set; }

        public Filter(int filterID)
        {
            FilterID = filterID;
        }

        public Filter(String filtername, int filterID)
        {
            Filtername = filtername;
            FilterID = filterID;
        }

        public void AddParameter(FilterParameter parameter)
        {
            this.parameters.Add(parameter);
        }

        public List<FilterParameter> GetParameters()
        {
            return parameters;
        }

        public override bool Equals(Object obj)
        {
            if (obj == null) return false;
            if (this.GetType() != obj.GetType()) return false;
            Filter filter = (Filter) obj;
            if (!FilterID.Equals(filter.FilterID)) return false;
            return true;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode() ^ FilterID;
        }

    }
}
